import user from './assets/img/24-users .png'

const list = {
  name: 'list',
  initialState: {
    isFetching: false,
    didInvalidate: false,
    items: [
      {
        name:'Barry Lyon',
        id:'001',
        phone:'34456789',
        logo:user
      },
      {
        name:'Miffy Cooper',
        id:'002',
        phone:'34456789',
        logo:user
      },
      {
        name:'Geoge Armani',
        id:'003',
        phone:'34456789',
        logo:user
      },
      {
        name:'Tom Ford',
        id:'004',
        phone:'34456789',
        logo:user
      },
      {
        name:'Yves SaintLaurent',
        id:'005',
        phone:'34456789',
        logo:user
      },
      {
        name:'Sheldon Cooper',
        id:'006',
        phone:'34456789',
        logo:user
      },
      {
        name:'Papi Jiang',
        id:'007',
        phone:'34456789',
        logo:user
      },
      {
        name:'Avene',
        id:'008',
        phone:'34456789',
        logo:user
      },
      {
        name:'Amber Zhao',
        id:'009',
        phone:'34456789',
        logo:user
      },
      {
        name:'Carl Hambledon',
        id:'010',
        phone:'34456789',
        logo:user
      },
      {
        name:'Leilah Gregory',
        id:'011',
        phone:'34456789',
        logo:user
      },
      {
        name:'Lowell Christophers',
        id:'012',
        phone:'34456789',
        logo:user
      },
      {
        name:'Angelica Geary',
        id:'013',
        phone:'34456789',
        logo:user
      },
      {
        name:'Noble Blythe',
        id:'014',
        phone:'34456789',
        logo:user
      },
      {
        name:'Hortense Tinker',
        id:'015',
        phone:'34456789',
        logo:user
      },
      {
        name:'Fatty Lei',
        id:'016',
        phone:'34456789',
        logo:user
      },
      {
        name:'Gaygay Lee',
        id:'017',
        phone:'34456789',
        logo:user
      },
      {
        name:'Kinny Lin',
        id:'018',
        phone:'34456789',
        logo:user
      },
      {
        name:'Pinky Yel',
        id:'019',
        phone:'34456789',
        logo:user
      },

      ],
  },
  sagas: {
    *list(action, {update, put, call}) {
      yield update({isFetching: true})

      // yield put({ type: "crudModules.REQUEST", payload: {isFetching: true} })
      const response = yield call(fetch, `/system/api/v1/modules`)
      if (response) {
        yield put({type: "crudModules.SUCCESS", response});
        // yield put({type: "crudModules.SUCCESS", Object.assign({})})
      } else {
        yield put({type: "crudModules.FAILURE", error})
      }
    },
    *update() {

    },
    *fetch() {
      yield console.log("fetching list");
    },
    *update() {

    },
    *destroy() {

    }
  }
}

export default list
